Auto-update ms.date in docs-mslearn on PR changes#1985
Merged
Conversation
Add GitHub Action workflow that automatically updates the ms.date field in docs-mslearn markdown files when they are modified in a pull request. This ensures documentation dates stay current without manual intervention. Also adds: - Pester unit test to validate the GitHub Action workflow - Pester lint test to validate ms.date format in all docs-mslearn files - New -Actions parameter to Test-PowerShell.ps1 for running Action tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces automation to keep Microsoft Learn documentation dates current by automatically updating the ms.date field in docs-mslearn markdown files when they are modified in a pull request. This reduces manual maintenance burden and ensures documentation metadata stays accurate.
Changes:
- Adds a GitHub Action workflow that triggers on docs-mslearn markdown file changes, updates ms.date to the current date, and commits the change back to the PR branch
- Implements comprehensive unit tests for the GitHub Action workflow structure and security
- Adds lint tests to validate ms.date format compliance across all docs-mslearn files
- Extends the test runner to support GitHub Action tests with a new
-Actionsparameter
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/update-mslearn-dates.yml | New workflow that auto-updates ms.date fields in changed docs-mslearn markdown files |
| src/powershell/Tests/Unit/Action.UpdateMsLearnDates.Tests.ps1 | Unit tests validating workflow structure, triggers, permissions, and security |
| src/powershell/Tests/Lint/MsLearnDocs.Tests.ps1 | Lint tests ensuring ms.date format compliance (MM/DD/YYYY) across all docs-mslearn files |
| src/scripts/Test-PowerShell.ps1 | Added -Actions parameter to run GitHub Action tests (Action.*.Tests.ps1 pattern) |
Use `git add -u docs-mslearn/` instead of wildcard pattern to only stage tracked files that were actually modified by the workflow. 🤖 Generated with [Claude Code](https://claude.ai/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
Author
|
🤖 [AI][Claude] PR Update Summary Addressed: 2 thread(s)
Changes: Updated |
RolandKrummenacher
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠️ Description
Add a GitHub Action workflow that automatically updates the
ms.datefield in docs-mslearn markdown files when they are modified in a pull request. This ensures documentation dates stay current without manual intervention.Changes include:
.github/workflows/update-mslearn-dates.yml): Triggers on PRs that modifydocs-mslearn/**/*.mdfiles, updates thems.datefrontmatter to the current date, and commits the change back to the PR branchAction.UpdateMsLearnDates.Tests.ps1): Validates the GitHub Action workflow structure, triggers, permissions, and security considerationsMsLearnDocs.Tests.ps1): Validates all docs-mslearn files have properms.datefrontmatter in MM/DD/YYYY format-Actionsparameter toTest-PowerShell.ps1for running GitHub Action tests (pattern:Action.*.Tests.ps1)📋 Checklist
🔬 How did you test this change?
🙋♀️ Do any of the following that apply?
📑 Did you update
docs/changelog.md?📖 Did you update documentation?